// @Author miaoqing
// @Date 2024/03/01 18:05:00
// @Desc
package logic

import "core/command"

func (oc *OnlineClient) onlineMsgToCenter(msgID uint16, data []byte) {
	msgRecv := &command.OnlineMsgToCenter{}
	err := oc.Router.UnMarshal(data, msgRecv)
	if err != nil {
		return
	}
	onlineClientMgr.recvOnlineCh <- msgRecv
}

func (oc *OnlineClient) registerCenter(msgID uint16, data []byte) {
	msgRecv := &command.RegisterToCenter{}
	err := oc.Router.UnMarshal(data, msgRecv)
	if err != nil {
		return
	}
	onlineClientMgrGetMe().addOnlineClient(oc, msgRecv.ServerID, msgRecv.ServerAddr, msgRecv.ProcIndex)
}
